package ${model.packageName}.${model.modulePackage}.dao;

import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.apa.biz.common.CustomRepostory;
import com.apa.biz.common.CustomRowBounds;
import ${model.packageName}.${model.modulePackage}.entity.${model.model}Entity;
/**
* ${model.model}Dao:${model.comment} 数据持久层接口
* @author ${model.author} ${date} 
*/
@Repository
public interface ${model.model}Dao extends JpaRepository<${model.model}Entity, Long>,
		JpaSpecificationExecutor<${model.model}Entity>,CustomRepostory<Map<String, Object>>{
    
    
    
    @Query("from ${model.model}Entity where code=:code and delFlag=0")
	${model.model}Entity findByCode(@Param("code") String code);
	
	@Query("from ${model.model}Entity where code=:code")
	${model.model}Entity findAllByCode(@Param("code") String code);
	 
	@Modifying
	@Query("update ${model.model}Entity set delFlag=1 where code=:code")
	int deleteByCode(@Param("code") String code);
	
    
   
	
	/**       
	* 分页查询获取合计
	* @param params
	* @return    
	*/
	public List<Map<String, Object>> selectSum(Map<String, Object> params);

	  
	
	/**       
	* 查询所有记录
	* @param params
	* @return          
	*/
	public List<Map<String, Object>> selectAll${model.model}(Map<String, Object> params);
	
	 
	
	     

}